package thread;

import thread.biz.DOrder;
import thread.biz.Diff;
import thread.biz.POrder;

/**
 * 串行处理
 */
public class CheckBatch1 extends AbstractCheckBatch {
    @Override
    public void doProcess() {
        System.out.println("---- 串行处理 ----");
        for (int id : ids) {
            POrder pOrder = pOrderService.getPOrder(id); // 20ms
            DOrder dOrder = dOrderService.getDOrder(id); // 100ms
            Diff diff = check(pOrder, dOrder);
            if (diff != null)
                save(diff); // 2ms
        }
    }

    @Override
    protected void doFinal() {
        // NoOP
    }
}
